package com.trf.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * web项目配置类
 *
 * @author 小小唐
 * @Date 2022/5/31-星期二-23:51
 */
@Configuration
public class WebAppConfigurer implements WebMvcConfigurer {

    /**
     * 资源处理，映射本地资源
     *
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        //本地轮播图地址
        registry.addResourceHandler("/image/swiper/**").addResourceLocations("file:C:\\Users\\29881\\Desktop\\tang\\swiperImgs\\");
        //本地商品大类地址
        registry.addResourceHandler("/image/bigType/**").addResourceLocations("file:C:\\Users\\29881\\Desktop\\tang\\bigTypeImgs\\");
        //本地热推商品地址
        registry.addResourceHandler("/image/product/**").addResourceLocations("file:C:\\Users\\29881\\Desktop\\tang\\productImgs\\");

    }
}
